package com.xiangshizhineng.tianzhangzhi.app.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xiangshizhineng.tianzhangzhi.app.common.PagingContext;
import com.xiangshizhineng.tianzhangzhi.app.common.SortingContext;
import com.xiangshizhineng.tianzhangzhi.app.common.base.BaseServiceImpl;
import com.xiangshizhineng.tianzhangzhi.app.dao.NoticeDAO;
import com.xiangshizhineng.tianzhangzhi.app.model.entity.TzMes;
import com.xiangshizhineng.tianzhangzhi.app.model.response.NoticeResponse;
import com.xiangshizhineng.tianzhangzhi.app.service.NoticeService;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;
import java.util.Vector;

@Service
@Slf4j
public class NoticeServiceImpl extends ServiceImpl<NoticeDAO, NoticeResponse> implements NoticeService {

    @Autowired
    NoticeDAO noticeDAO;

    @Override
    public List<NoticeResponse> allNotice() {
        return noticeDAO.allNotice();
    }

    @Override
    public NoticeResponse noticeDetails(Long id) {
        return noticeDAO.noticeDetails(id);
    }

    @Override
    public List<NoticeResponse> tNEPics() {
        return noticeDAO.tNEPics();
    }

    @Override
    public int maxId() {
        return noticeDAO.maxId();
    }


    private Map<String, Object> getUnionParams(@NonNull Map<String, Object> params, Vector<SortingContext> scs, PagingContext pc) {
        params.put("pc", pc);
        params.put("scs", scs);
        return params;
    }
}
